SpatialStream® Code Examples

School Attendance Boundaries

This example uses the GetGeocode functional component, and illustrates one of the interactive mapping features you can implement using the geocode result from the GetGeocode functional component. Here, the address, city, state and zipcode of a location are passed into the geocoding engine using GetGeocode, and depending on the result the school district and schools that the location attends are returned.

GetGeocode

var layer = new Dmp.Layer.TileLayer("Parcels", "SS");
layer.addChild("ParcelTiles", "SS.Base.Parcels/ParcelTiles", "", {
zIndex: 3, zoomRange: {
min: 16, max: 19
}
});
map.addEntity(layer);

//----------------

var url = "GetGeocode.aspx?";
url += "&address=" + document.getElementById("address").value;
url += "&city=" + document.getElementById("city").value;
url += "&state=" + document.getElementById("state").value;
url += "&zip=" + document.getElementById("zip").value;
url += "&fields=*,[resource](GEOMETRY),MPSCHOOLAZ(*),MPSCHOOLDISTRICT(*)";
url += "&datasource=PARCELS,STREET_CENTERLINE";
url += "&showschema=false";

Dmp.Env.Connections["SS"].getJson(url, geocodeSuccess, geocodeFailure);


Run Sample   Back To Index